﻿package  
{
	
	
	/**
	 * ...
	 * @author spe
	 */
	import flash.display.*;
	import flash.events.*;
	import com.ixiyou.utils.*;
	import com.ixiyou.utils.display.*;
	import com.ixiyou.utils.layout.*;
	import flash.geom.Point;
	public class testArrangeShowUtil extends Sprite
	{
		
		private var _ale:uint = 0
		private var _arr:Array
		private var _box:Sprite = new Sprite()
		private var _w:Number = 11
		private var _h:Number=13
		public function testArrangeShowUtil() 
		{
			addChild(_box)
			_box.x=10
			_box.y = 10
			
			//测试网格
			//grid()
			//测试环形排列
			ring2()
			ArrangeShowUtil.ringPointNum()
		}
		private function ring3():void {
			var obj:Object=ArrangeShowUtil.ringPoint(11,12,100,100,100,100)
			_box.graphics.clear()
			_box.graphics.beginFill(0x0)
			_box.graphics.drawCircle(100, 100, 100)
			var temp:Sprite = new Sprite()
			temp.graphics.beginFill(RandomUtil.color)
			temp.graphics.drawRect(0, 0, _w, _h)
			temp.x = obj.x;
			temp.y = obj.y;
			temp.alpha = obj.value;
			_box.addChild(temp)
		}
		private function  ring2():void {
			
			//[Embed(source='../../lib/skins/VScrollBarSkin/test.png')]
			//var bmp:Class
			//addChild(new bmp() as DisplayObject)
			//addChild(_box)
			_box.graphics.clear()
			_box.graphics.beginFill(0x0)
			_box.graphics.drawRect(0,0,300,300)
			var arr:Array = ArrangeShowUtil.ringSuperPointArr(18)
			//trace(arr)
			for (var i:int = 0; i < arr.length; i++) 
			{
				var temp:Sprite = new Sprite()
				temp.graphics.beginFill(RandomUtil.color)
				temp.graphics.drawRect(0, 0, _w, _h)
				temp.x =arr[i].x
				temp.y = arr[i].y
				var value:Number=arr[i].value 
				if (value!= 1) temp.alpha = .3 * value
				//if (value!= 1)temp.filters=[MFilters.getBlurFilter(10*value,10*value)]
				_box.addChild(temp)
				
			}
		}
		//测试环形排列
		private function ring():void {
			_box.graphics.clear()
			//_box.graphics.beginFill(0x0)
			//_box.graphics.drawRect(0,0,200,100)
			var arr:Array = ArrangeShowUtil.ringPointArr(8)
			trace(arr)
			for (var i:int = 0; i < arr.length; i++) 
			{
				var temp:Sprite = new Sprite()
				temp.graphics.beginFill(RandomUtil.color,.5)
				temp.graphics.drawRect(0, 0, _w, _h)
				temp.x = Point(arr[i]).x
				temp.y = Point(arr[i]).y
				_box.addChild(temp)
			}
		}
		//测试网格
		private function grid():void {
			_box.graphics.clear()
			_box.graphics.beginFill(0x0)
			_box.graphics.drawRect(0,0,100,100)
			var arr:Array = ArrangeShowUtil.gridCenterIntervalPointArr(_w, _h, 100, 100)
			trace(arr)
			for (var i:int = 0; i < arr.length; i++) 
			{
				var temp:Sprite = new Sprite()
				temp.graphics.beginFill(RandomUtil.color,.5)
				temp.graphics.drawRect(0, 0, _w, _h)
				temp.x = Point(arr[i]).x
				temp.y = Point(arr[i]).y
				_box.addChild(temp)
			}
		}
		
	}

}